/**
 * Basic usage example for daily-web-opener
 */
import { createScheduler, loadConfig } from '../src/index.js';

// Example 1: Simple daily schedule
const basicConfig = loadConfig({
  url: 'https://github.com',
  cron: '0 9 * * 1-5'  // 9 AM, Monday to Friday
});

const scheduler = createScheduler(basicConfig);

console.log('Starting basic scheduler...');
scheduler.start();

// Example 2: Multiple windows with delay
setTimeout(() => {
  const advancedConfig = loadConfig({
    url: 'https://stackoverflow.com',
    cron: '0 8 * * *',     // 8 AM daily
    multiple: true,
    delay: 5000            // 5 second delay between windows
  });
  
  const advancedScheduler = createScheduler(advancedConfig);
  console.log('Advanced configuration created');
}, 2000);

// Cleanup on exit
process.on('SIGINT', () => {
  console.log('\nShutting down...');
  scheduler.stop();
  process.exit(0);
});